let str = "abcderg";

function isPalindromic(str) {
  let arr = [...str];
  if (arr.reverse().join("") === str) {
    return true;
  } else {
    return false;
  }
}

console.log(isPalindromic(str));
